

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>Multipath and Anaconda &mdash; Anaconda 25.14 documentation</title>
  

  
  

  

  
  
    

  

  
  
    <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  

  

  
    <link rel="top" title="Anaconda 25.14 documentation" href="index.html"/>
        <link rel="next" title="pyanaconda" href="modules.html"/>
        <link rel="prev" title="iSCSI and Anaconda" href="iscsi.html"/> 

  
  <script src="_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav" role="document">

  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="index.html" class="icon icon-home"> Anaconda
          

          
          </a>

          
            
            
              <div class="version">
                25.14
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
                <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction to Anaconda</a></li>
<li class="toctree-l1"><a class="reference internal" href="release.html">Building a Release</a></li>
<li class="toctree-l1"><a class="reference internal" href="boot-options.html">Anaconda Boot Options</a></li>
<li class="toctree-l1"><a class="reference internal" href="kickstart.html">Anaconda Kickstart Documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="commit-log.html">Rules for commit messages</a></li>
<li class="toctree-l1"><a class="reference internal" href="driverdisc.html">Brief description of DriverDisc version 3</a></li>
<li class="toctree-l1"><a class="reference internal" href="iscsi.html">iSCSI and Anaconda</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">Multipath and Anaconda</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="#what-is-expected-from-anaconda">What is expected from Anaconda</a></li>
<li class="toctree-l2"><a class="reference internal" href="#how-anaconda-handles-multipath">How Anaconda handles multipath</a></li>
<li class="toctree-l2"><a class="reference internal" href="#debugging-multipath-bugs">Debugging multipath bugs</a></li>
<li class="toctree-l2"><a class="reference internal" href="#future-of-multipath-in-anaconda">Future of multipath in Anaconda</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">pyanaconda</a></li>
<li class="toctree-l1"><a class="reference internal" href="testing.html">Testing</a></li>
<li class="toctree-l1"><a class="reference internal" href="tests/modules.html">tests</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
        <a href="index.html">Anaconda</a>
      </nav>


      
      <div class="wy-nav-content">
        <div class="rst-content">
          





<div role="navigation" aria-label="breadcrumbs navigation">
  <ul class="wy-breadcrumbs">
    <li><a href="index.html">Docs</a> &raquo;</li>
      
    <li>Multipath and Anaconda</li>
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="_sources/multipath.txt" rel="nofollow"> View page source</a>
          
        
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="multipath-and-anaconda">
<h1>Multipath and Anaconda<a class="headerlink" href="#multipath-and-anaconda" title="Permalink to this headline">¶</a></h1>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Authors:</th><td class="field-body">Ales Kozumplik &lt;<a class="reference external" href="mailto:akozumpl&#37;&#52;&#48;redhat&#46;com">akozumpl<span>&#64;</span>redhat<span>&#46;</span>com</a>&gt;</td>
</tr>
</tbody>
</table>
<div class="section" id="introduction">
<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
<p>If there are two block devices in your /dev for which udev reports the same
&#8216;ID_SERIAL&#8217; then you can create a certain device mapper device which arbitrarily
uses those devices to access the physical device. And that is Multipath [1].</p>
<p>For instance, suppose there are:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span>/dev/sda, with ID_SERIAL of 20090ef12700001d2, and
/dev/sdb, with the same ID_SERIAL.
</pre></div>
</div>
<p>Those are probably some adapters in the system that just connect your box to a
storage area network (SAN) somewhere. There are perhaps two cables, one for sda,
one for sdb, and if one of the cables gets cut the other can still transmit
data. Normally the system won&#8217;t recognize that sda and sdb have this special
relation to each other, but by creating a suitable device map using multipath
tools [2] we can create a DM device /dev/mapper/mpatha and use it for storing
and retrieving data.</p>
<p>The device mapper then automatically routes IO requests to /dev/mapper/mpatha to
either sda or sdb depending on the load of the line or network congestion on the
particular network etc.</p>
<p>The nomenclature I will use here is:
- &#8216;multipath device&#8217; for the smart /dev/mapper/mpathX device.
- &#8216;multipath member device&#8217; for the &#8216;/dev/sdX&#8217; devices. Also &#8216;a path&#8217;.</p>
</div>
<div class="section" id="what-is-expected-from-anaconda">
<h2>What is expected from Anaconda<a class="headerlink" href="#what-is-expected-from-anaconda" title="Permalink to this headline">¶</a></h2>
<p>Anaconda is expected to:
- detect that there are multipath devices present
- coalesce all relevant (e.g. exclusiveDisks) multipath devices.
- only let the user interact with the multipath devices in filtering,</p>
<blockquote>
<div>cleardiskssel and partition screen, that is once we know &#8216;sdc&#8217; and &#8216;sdd&#8217; are
part of &#8216;mpathb&#8217; show only &#8216;mpathb&#8217; and never the paths.</div></blockquote>
<ul class="simple">
<li>install bootloader and boot from an mpath device</li>
<li>make it happen so all the multipath devices (carrying or not the root
filesystem) we used for installation are correctly coalesced in the booted
system. This is achieved by generating a suitable /etc/multipath.conf and
writing it into sysroot.</li>
<li>be able to refer to mpath devices from kickstart, either by name like &#8216;mpatha&#8217;
or by their id like &#8216;disk/by-id/scsi-20090ef12700001d2&#8217;</li>
</ul>
</div>
<div class="section" id="how-anaconda-handles-multipath">
<h2>How Anaconda handles multipath<a class="headerlink" href="#how-anaconda-handles-multipath" title="Permalink to this headline">¶</a></h2>
<p>To detect presence of multipath devices we rely on multipath tools. The same we
do for coalescing, see pyanaconda/storage/devicelibs/mpath.py, the file that
provides some abstraction from mpath tools. During the device scan we use the
&#8216;multipath -d&#8217; output to find out what devices are going to end up as multipath
members. The MultipathTopology object also enhances the multipath member&#8217;s udev
dictionaries with &#8216;ID_FS_TYPE&#8217; set to &#8216;multipath_member&#8217; (yes, this is a hack
surviving from the original mpath implementation, and righteous is he who
eradicates it). This information is picked up by DeviceTree when populating
itself. Meaning, if &#8216;sda&#8217; and &#8216;sdb&#8217; are multipath member devices DeviceTree
gives them MultipathMember format and creates one MultipathDevice for them (we
know its name from &#8216;multipath -d&#8217;). We end up with:</p>
<p>DiskDevice &#8216;sda&#8217;, format &#8216;MultipathMember&#8217;
DiskDevice &#8216;sdb&#8217;, format &#8216;MultipathMember&#8217;
MultipathDevice &#8216;mpatha&#8217;, parents are &#8216;sda&#8217; and &#8216;sdb&#8217;.</p>
<p>From then on, Anaconda only deals with the MultipathDevice and generally leaves
anything with &#8216;MultipathMember&#8217; format alone (understand, this is an inert
format that really is not there but we use it just to mark the device as
&#8220;useless beyond a multipath member&#8221;, kind of like MDRaidMember).</p>
<p>Partition happens over the multipath device and during the preinstallconfig step
/mnt/sysimage/etc/multipath.conf is created and filled with information about
the coalesced devices. This is handled in the Storage.write() method. It is
important this file and /etc/multipath/wwids (autogenerated by mpath tools)
make it to the sysimage before the dracut image is generated.</p>
</div>
<div class="section" id="debugging-multipath-bugs">
<h2>Debugging multipath bugs<a class="headerlink" href="#debugging-multipath-bugs" title="Permalink to this headline">¶</a></h2>
<p>Unlike with iSCSI, to reproduce a multipath bug one does not need the same
specific hardware as the reporter. Just found any box connected to a multipathed
SAN and you are fine (at the moment, connecting to the same iSCSI target through
its IPv4 and IPv6 address also produces a multipathed device).</p>
<p>On top of that, much of the necessary information is already included in the
anaconda logs or can be easily extracted from the reporter. The things to
particularly look at are:</p>
<ul class="simple">
<li>storage.log, the output around &#8216;devices to scan for multipath&#8217; and &#8216;devices
post multipath scan&#8217;. The latter shows a triple with regular disks, disks
comprising multipath devices and partitions. This helps you quickly find out
what the target system is about.</li>
<li>this information is also in program.log&#8217;s calls to &#8216;multipath&#8217; [3]. If mpath
devices are mysteriously appearing/disappearing between filtering and
partitioning screens look at those. &#8216;multipath -ll&#8217; is called to display
currently coalesced mpath devices, &#8216;multipath -d&#8217; is called to show the mpath
devices that would be coalesced if we ran &#8216;multipath&#8217; now. This is exploited
by the device filtering screen.</li>
</ul>
</div>
<div class="section" id="future-of-multipath-in-anaconda">
<h2>Future of multipath in Anaconda<a class="headerlink" href="#future-of-multipath-in-anaconda" title="Permalink to this headline">¶</a></h2>
<p>Overall as of RHEL6.2, the shape of multipath in Anaconda is good and what&#8217;s
more important it is flexible enough to sustain new RFEs and bugs. Those are
however bugs that I expect to appear sometime soon:</p>
<ul class="simple">
<li>enable or disable mpath_friendly_names in kickstart. Disabling friendly names
just means the mpath devices are called by their wwid,
e.g. /dev/mapper/360334332345343234, not &#8216;/dev/mapper/mpathc&#8217;. This is
straightforward to implement.</li>
<li>extend support for mpath devices in kickstart in general. Currently mpath
devices should be accepted in most commands but I am sure there will be corner
cases. Difficulty medium.</li>
<li>[rawhide] stop extending the udev info dictionary with &#8216;ID_FS_TYPE&#8217; and
&#8216;ID_MPATH_NAME&#8217;. Doing it this way is asking for the trouble if a dictionary
of particular mpath device is reloaded from udev without running it through
the MultipathTopology object as it will miss those entries (and DeviceTree
depends on them a lot). Difficulty hard, but includes a lot of pleasant
refactoring.</li>
<li>Improve support for multipathing iSCSI devices. Someone might ask for it one
day (in fact, with the NIC bounding they already did), and it will make mpath
debugging possible on any virt machine with multiple virt NICs.</li>
</ul>
<table class="docutils footnote" frame="void" id="id1" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[1]</td><td><a class="reference external" href="http://akozumpl.fedorapeople.org/archive/Multipass.jpg">http://akozumpl.fedorapeople.org/archive/Multipass.jpg</a></td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id2" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[2]</td><td><a class="reference external" href="http://christophe.varoqui.free.fr/">http://christophe.varoqui.free.fr/</a></td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id3" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[3]</td><td>&#8216;man 8 multipath&#8217;</td></tr>
</tbody>
</table>
</div>
</div>


           </div>
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="modules.html" class="btn btn-neutral float-right" title="pyanaconda" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="iscsi.html" class="btn btn-neutral" title="iSCSI and Anaconda" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2015, Red Hat, Inc..

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'./',
            VERSION:'25.14',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  true
        };
    </script>
      <script type="text/javascript" src="_static/jquery.js"></script>
      <script type="text/javascript" src="_static/underscore.js"></script>
      <script type="text/javascript" src="_static/doctools.js"></script>

  

  
  
    <script type="text/javascript" src="_static/js/theme.js"></script>
  

  
  
  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.StickyNav.enable();
      });
  </script>
   

</body>
</html>